home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
New Star Software Collection
/
NSS_Collection.iso
/
3-004 ms visual basic pro 30
/
4.imz
/
4.IMA
/
ANIMATE.FR_
/
ANIMATE.bin
Wrap
Text File
|
1993-04-28
|
5KB
|
185 lines
VERSION 2.00
Begin Form Animate
BackColor = &H00404040&
BorderStyle = 1 'Fixed Single
Caption = "MCI Animation Theater"
ClientHeight = 5790
ClientLeft = 1065
ClientTop = 705
ClientWidth = 7695
Height = 6480
Left = 1005
LinkMode = 1 'Source
LinkTopic = "Form3"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5790
ScaleWidth = 7695
Top = 75
Width = 7815
Begin MMControl MMControl1
EjectVisible = 0 'False
Height = 495
Left = 2520
RecordVisible = 0 'False
TabIndex = 1
Top = 5040
Width = 2760
End
Begin Frame Frame1
BackColor = &H00808080&
Height = 4860
Left = 120
TabIndex = 0
Top = -120
Width = 7455
Begin Frame Frame3
BackColor = &H00000080&
Caption = "(((((((((((((((((((((((((((((((((((((((((((((((((((((((("
Height = 4695
Left = 3720
TabIndex = 3
Top = 120
Width = 3720
End
Begin PictureBox Picture1
Height = 4695
Left = 720
ScaleHeight = 4665
ScaleWidth = 5865
TabIndex = 4
Top = 120
Visible = 0 'False
Width = 5895
End
Begin Frame Frame2
BackColor = &H00000080&
Caption = ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))"
Height = 4695
Left = 0
TabIndex = 2
Top = 120
Width = 3720
End
End
Begin Menu AL_FILE
Caption = "&File"
Begin Menu AI_OPEN
Caption = "&Open..."
End
Begin Menu AI_SEPARATOR
Caption = "-"
End
Begin Menu AI_EXIT
Caption = "&Exit"
End
End
End
Dim HwndFrame As Integer
Dim CurtainFlag As Integer
Sub AI_EXIT_Click ()
Unload Animate
End Sub
Sub AI_OPEN_Click ()
' Display the "File Open..." dialog.
OpenDlg.CMDialog1.FilterIndex = 1
OpenDlg.CMDialog1.Flags = OFN_READONLY Or OFN_FILEMUSTEXIST
OpenDlg.CMDialog1.CancelError = True
OpenDlg.CMDialog1.FileName = ""
On Error Resume Next
OpenDlg.CMDialog1.Action = 1
If Err <> 0 Then
' No file selected in the "File Open..." dialog.
Exit Sub
End If
' If the device is already open, close it.
If Not mmcontrol1.Mode = MCI_MODE_NOT_OPEN Then
mmcontrol1.Command = "Close"
End If
' Open the device with the new filename.
mmcontrol1.FileName = OpenDlg.CMDialog1.FileName
caption = DialogCaption + mmcontrol1.FileName
'Attempt to open the Animation device
On Error Resume Next
mmcontrol1.Command = "Open"
'If the open faild, try the MMMovie device name
If Err = MCIERR_DEVICE_OPEN Then
mmcontrol1.DeviceType = "MMMovie"
If Not mmcontrol1.Mode = MCI_MODE_NOT_OPEN Then
mmcontrol1.Command = "Close"
End If
On Error GoTo MCI_ERROR
mmcontrol1.Command = "Open"
End If
' If the curtains haven't been opened, open them.
If CurtainFlag = False Then
OpenCurtain
End If
' Play the movie into the picture control.
On Error GoTo MCI_ERROR
mmcontrol1.Command = "Play"
On Error GoTo 0
Exit Sub
MCI_ERROR:
DisplayErrorMessageBox
Resume MCI_EXIT
MCI_EXIT:
Unload Animate
End Sub
Sub Form_Load ()
CurtainFlag = False
End Sub
Sub Form_Unload (Cancel As Integer)
If Not mmcontrol1.Mode = MCI_MODE_NOT_OPEN Then
mmcontrol1.Command = "CLOSE"
End If
MCITest.Show
End Sub
' This subroutine moves the frame controls slightly
' to the left and right to simulate curtains opening.
Sub OpenCurtain ()
Dim i As Integer
For i = 1 To 25
frame2.Left = frame2.Left - 100
frame3.Left = frame3.Left + 100
Next i
' Display the picture control.
Picture1.Visible = True
WaitForEventsToFinish 50
' Set the focus to the picture control, so that the
' hwnd for the picture control can be retrieved.
Picture1.SetFocus
WaitForEventsToFinish 50
' Play the movie in this control rather than playing
' the movie in a default popup window.
mmcontrol1.hWndDisplay = HwndFrame
' Once the curtain is opened, don't open it again.
CurtainFlag = True
End Sub
Sub Picture1_GotFocus ()
' The movie is played into this control.
HwndFrame = GetFocus()
End Sub